export default function get_query(url: string) {
	if (!url) {
		throw new Error('url could not be null.');
	}
	const s = url.indexOf('?');
	if (s === -1) {
		return {};
	} else {
		const urlseachparams: any = new URLSearchParams(url.substring(s + 1));
		return Array.from(urlseachparams.entries()).reduce((obj, [key, val]) => {
			obj[key] = val;
			return obj;
		}, {});
	}
}
